<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <script src="../js/datetime_utils.js"></script>

</head>
<body>

<div id="div1" >

    <div>{{date | format('yyyy-MM-dd hh:MM:ss')}}</div>

</div>
<script>

    Vue.filter('format', function (value,format) {     //全局的过滤器
        console.log(value);
        console.log(format);
        return dateFormat(value,format);
    });

    const vueObj = new Vue({
        el: '#div1',
        data: {
            date: new Date(),

        },



    });



</script>
</body>
</html>